from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
chrome_driver=webdriver.Chrome()
chrome_driver.maximize_window()
def login_demo():
    chrome_driver.get("http://www.job5156.com/")
    WebDriverWait(chrome_driver,8).until(EC.element_to_be_clickable((By.CLASS_NAME,"login-per-dialog")))
    login_control=chrome_driver.find_element_by_class_name("login-per-dialog")
    login_control.click()
    WebDriverWait(chrome_driver,15).until(EC.element_to_be_clickable((By.ID,"user_accoun2")))
    id_control=chrome_driver.find_element_by_id("user_account2")
    id_control.send_keys("用户名")
    WebDriverWait(chrome_driver,15).until(EC.element_to_be_clickable((By.ID,"user_password2")))
    pwd_control=chrome_driver.find_element_by_id("user_password2")
    pwd_control.send_keys("密码")
    WebDriverWait(chrome_driver,15).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="jbox-content"]/form/a')))
    login_demo_control=chrome_driver.find_element_by_xpath('//*[@id="jbox-content"]/form/a')
    login_demo_control.click()